#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTcpSocket>
#include <QTimer>

#include "connectform.h"
#include "cardcontrollerform.h"
#include "connectionstatusform.h"


namespace Ui
{
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

    public:
        explicit MainWindow(QWidget *parent = 0);
        ~MainWindow();

    private:
        void sendCommande(QString commande);
        void sendMessage(QString message);

    private slots:
        void slot_connect();
        void slot_disconnect();
        void slot_errorSocket(QAbstractSocket::SocketError error);
        void slot_readData();
        void slot_connectionAsked(QHostAddress address, qint16 port);

        void on_deconnection();
        void on_ledOn();
        void on_ledOff();
        void on_actualized();
        void on_messageSent(QString message);
        void on_connectButton_clicked();
        void on_sliderSet(int angle);

private:
        Ui::MainWindow *ui;
        QTcpSocket m_clientSocket;
        qint16 blockSize;
        ConnectForm *connectForm;
        CardControllerForm * controllerForm;
        ConnectionStatusForm *connectionStatus;

};

#endif // MAINWINDOW_H
